package com.gwnet.cabinet.enums;

/**
 * 第三方数据响应的枚举类
 * @author: WangLiang
 * @date: 2024/7/22 16:17
 */
public enum ResultCodeEnum {


    SUCCESS(200,"操作成功"),

    VALIDATE_FAIL(401,"登录已失效"),

    ALREADY_USED(400,"箱子正在使用中");

    private Integer code;
    private String desc;

    ResultCodeEnum(Integer code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public Integer code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    public static ResultCodeEnum instance(Integer value) {
        ResultCodeEnum[] enums = values();
        for (ResultCodeEnum statusEnum : enums) {
            if (statusEnum.code().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

}
